<script>
	import Vue from "vue"
	import pageAnimation from '@/components/page-animation'
	export default {
		mixins: [pageAnimation],
		onLaunch: function() {
			uni.getSystemInfo({
				success: function(e) {
					// #ifndef MP
					Vue.prototype.StatusBar = e.statusBarHeight;
					if (e.platform == 'android') {
						Vue.prototype.CustomBar = e.statusBarHeight + 50;
					} else {
						Vue.prototype.CustomBar = e.statusBarHeight + 45;
					};
					// #endif

					// #ifdef MP-WEIXIN
					Vue.prototype.StatusBar = e.statusBarHeight;
					let custom = wx.getMenuButtonBoundingClientRect();
					Vue.prototype.Custom = custom;
					Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
					// #endif		

					// #ifdef MP-ALIPAY
					Vue.prototype.StatusBar = e.statusBarHeight;
					Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;
					// #endif
				}
			})
			
			let _this = this
			uni.getStorage({
				key:"userInfo",
				success:function(data){
					_this.$store.commit("user/setUserInfo",data.data)
				},
				fail:function(){
					_this.$store.commit("user/setUserInfo",null)
				}
			})
			
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>


<style>
	@import url("//at.alicdn.com/t/font_2139421_ac288g3kl2v.css");
</style>
<style lang="scss">
	@import "uview-ui/index.scss";
	@import "./components/custom/main.css";
	*{
		margin: 0;
		padding: 0;
	}
	view,text{
		font-size: 24rpx;
		line-height: 1.5;
	}
	
	image{
		width: 100%;
	}
</style>
